package cz.muni.fi.pa165.musiclibrary.musiclibraryclient;

import cz.muni.fi.pa165.musiclibrary.Artist;
import java.util.ArrayList;
import java.util.List;
import javax.swing.AbstractListModel;

/**
*
* @author Radoslav Stefanik 
* 2012-12-09T18:36:42+0100
*/
public final class ArtistListModel extends AbstractListModel<Artist> {

    List<Artist> artists;

    public ArtistListModel() {
        artists=new ArrayList<Artist>();
    } 

    public void setArtists(List<Artist> artists) {
        this.artists = artists;
        fireContentsChanged(this, 0, getSize());
    }
    
    @Override
    public int getSize() {
        return artists.size();
    }

    @Override
    public Artist getElementAt(int index) {
        return artists.get(index);
    }

}